package com.nms.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="t_user_info")
public class UserInfo {

	private String id;
	/** 用户姓名 */
	private String name;
	/** 生日*/
	private Date birthday;
	/** 用户籍贯 (故乡)*/
	private Location nativePlace;
	/** 所在地*/
	private Location location;
	/** 个性签名**/
	private String signature;
	/** 用户性别 */
	private String gender;
	/** 用户邮箱  */
	private String email;
	/** 用户手机/电话 */
	private String phone;
	/** 用户QQ */
	private String qq;
	/** 用户工作单位/部门 */
	private AssistInfo assistInfo;
	/** 身份证*/
	private String identityID;

	@Id
	@Column(length=64)
	@GeneratedValue(generator="uuid")
	@GenericGenerator(name="uuid",strategy="uuid")
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	/**
	 * 获得用户姓名
	 * @return
	 */
	@Column
	public String getName() {
		return name;
	}

	/**
	 * 设置用户姓名
	 * @param name
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * 获得用户性别
	 * @return
	 */
	@Column
	public String getGender() {
		return gender;
	}

	/**
	 * 设置用户性别
	 * @param gender
	 */
	public void setGender(String gender) {
		this.gender = gender;
	}

	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	@JoinColumn(name="location_id", referencedColumnName="id")
	public Location getLocation() {
		return location;
	}

	public void setLocation(Location location) {
		this.location = location;
	}

	/**
	 * 获得用户籍贯
	 * @return
	 */
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	@JoinColumn(name="native_location_id", referencedColumnName="id")
	public Location getNativePlace() {
		return nativePlace;
	}

	/**
	 * 设置用户籍贯
	 * @param nativePlace
	 */
	public void setNativePlace(Location nativePlace) {
		this.nativePlace = nativePlace;
	}

	/**
	 * 获得用户邮箱
	 * @return
	 */
	@Column
	public String getEmail() {
		return email;
	}

	/**
	 * 设置用户邮箱
	 * @param email
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * 获得用户手机/电话
	 * @return
	 */
	@Column
	public String getPhone() {
		return phone;
	}
	/**
	 * 设置用户手机/电话
	 * @param phone
	 */
	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column
	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	@Column
	public String getSignature() {
		return signature;
	}

	public void setSignature(String signature) {
		this.signature = signature;
	}

	@OneToOne(cascade=CascadeType.ALL)
	@JoinColumn(name="assist_info_id", referencedColumnName="id")
	public AssistInfo getAssistInfo() {
		return assistInfo;
	}

	public void setAssistInfo(AssistInfo assistInfo) {
		this.assistInfo = assistInfo;
	}

	@Column(name="identity_id")
	public String getIdentityID() {
		return identityID;
	}

	public void setIdentityID(String identityID) {
		this.identityID = identityID;
	}

	/**
	 * 获得用户QQ
	 * @return
	 */
	@Column
	public String getQq() {
		return qq;
	}

	/**
	 * 设置用户QQ
	 * @param qq
	 */
	public void setQq(String qq) {
		this.qq = qq;
	}

}
